﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="Web.Admin.Page_Template.List" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>

<!DOCTYPE html>

<%="<!--[if IE 8]> <html class=\"ie8 no-js\"> <![endif]-->"%>
<%="<!--[if IE 9]> <html class=\"ie9 no-js\"> <![endif]-->"%>
<%="<!--[if !IE]><!-->"%>
<html>
<%="<!--<![endif]-->"%>
    <!-- BEGIN HEAD -->

    <head>
        <meta charset="utf-8" />
        <title><%=Evan.Common.CommFun.GetAppSetting("AdminTitle") %> - 模板管理系统</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta content="width=device-width, initial-scale=1" name="viewport" />
        <!-- #include file="../include/com_res_css.inc" -->
    </head>
    <!-- END HEAD -->

    <body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
        <!-- BEGIN HEADER -->
        
        <!-- #include file="../include/top_bar.inc" -->

        <!-- END HEADER -->
        <!-- BEGIN HEADER & CONTENT DIVIDER -->
        <div class="clearfix"> </div>
        <!-- END HEADER & CONTENT DIVIDER -->
        <!-- BEGIN CONTAINER -->
        <div class="page-container">
            <!-- BEGIN SIDEBAR -->
            
            <!-- #include file="../include/left_menu.inc" -->
            
            <!-- END SIDEBAR -->
            <!-- BEGIN CONTENT -->
            <div class="page-content-wrapper">
                <!-- BEGIN CONTENT BODY -->
                <div class="page-content">
                    <!-- BEGIN PAGE HEADER-->
                    <!-- BEGIN THEME PANEL -->
                    <!-- #include file="../include/theme_panel.inc" -->
                    <!-- END THEME PANEL -->
                 
                    <!-- BEGIN PAGE TITLE-->
                    <h3 class="page-title" style="margin-top:0px;"> <%=TempPageTitle %>列表 </h3>
                    <!-- END PAGE TITLE-->
                    <!-- END PAGE HEADER-->
                    <!-- BEGIN PAGE CONTENT-->
                    
                    <div class="btn-group">
                        <a href="Edit.aspx?t=<%=TemplateCategory %>&action=add<%=TemplateCategory %>"><button type="button" class="btn default">
                            <i class="fa fa-plus"></i> 增加<%=TempPageTitle %></button></a>
                    </div>

                    <div class="table-scrollable">

                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th scope="col" class="manager_tab_center">选择</th>
                                    <th scope="col"><%=TempPageTitle %>名称</th>
                                    <th scope="col" class="manager_tab_center" style="width:200px;">添加时间</th>
                                    <th scope="col" class="">文件路径</th>
                                    <th scope="col" class="manager_tab_center" style="width:330px;">模板操作项</th>
                                    <th scope="col" class="manager_tab_center" style="width:200px;">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <% foreach (var item in Lists) { %>
                                <tr>
                                    <td class="manager_tab_check"> 
                                        <label class="mt-checkbox mt-checkbox-outline">
                                            <input type="checkbox" class="check-one" id="check-<%=item.Id %>"  data-id="<%=item.Id %>" />
                                            <span></span>
                                        </label>
                                    </td>
                                    <td><a onclick="javascript:window.location.href='Edit.aspx?t=<%=TemplateCategory %>&action=edit<%=TemplateCategory %>&Id=<%=item.Id %>';"><%=item.Title %></a></td>
                                    <td class="manager_tab_center"><%=item.AddTime.ToString("yyyy-MM-dd HH:mm:ss") %></td>
                                    <% if (TemplateCategory == "Template") { %>
                                    <td class=""><%="/templates/"+(string.IsNullOrEmpty(item.TemplatePath)?"":item.TemplatePath+"/")+item.TemplateName+".aspx" %></td>
                                    <%}else if(TemplateCategory == "Component"){ %>
                                    <td class=""><%="/templates/_include/" + (string.IsNullOrEmpty(item.TemplatePath)?"":item.TemplatePath+"/")+item.TemplateName+".html" %></td>
                                    <%} %>
                                    <td class="manager_tab_center">
                                        <a href="javascript:;" class="btn btn-xs <%=(item.States==0?"red":"default") %> states" data-tip-type="<%=TempPageTitle %>" data-id="<%=item.Id %>" data-title="<%=item.Title %>" data-states="<%=item.States %>"> 锁定 <i class="fa fa-lock"></i></a>
                                        <a href="/ModuleLayout/TemplateLayout.aspx?templateId=<%=item.Id %>" target="_blank" class="btn btn-xs default"> 编辑页面 <i class="fa fa-edit"></i></a>
                                        <% if ((!GlobalConfigModel.IsModuleSystem && GlobalConfigModel.Dev) || GlobalConfigModel.Dev) { %>
                                        <a href="TemplateCodeEditor.aspx?t=<%=TemplateCategory %>&Id=<%=item.Id %>" target="_blank" class="btn btn-xs default btn-info"><i class="fa fa-code"></i> 编辑模板代码 <i class="fa fa-code"></i></a>
                                        <%--<a onclick="javascript:alert('功能正在开发中'); return false;" href="TemplateModuleList.aspx?t=<%=TemplateCategory %>&Id=<%=item.Id %>" target="_blank" class="btn btn-xs default btn-info"><i class="fa fa-code"></i> 编辑模块代码 <i class="fa fa-code"></i></a>--%>
                                        <% } %>
                                    </td>
                                    <td class="manager_tab_center">
                                        <div class="btn-group btn-group-xs btn-group-solid">
                                            <%--<button type="button" class="btn blue" onclick="javascript:alert('功能正在开发中');"><i class="fa fa-copy"></i> 复制</button>--%>
                                            <button type="button" class="btn green" onclick="javascript:window.location.href='Edit.aspx?t=<%=TemplateCategory %>&action=edit<%=TemplateCategory %>&Id=<%=item.Id %>';"><i class="fa fa-edit"></i> 编辑</button>
                                            <button type="button" class="btn red del" data-tip-type="<%=TempPageTitle %>" data-id="<%=item.Id %>" data-title="<%=item.Title %>"><i class="fa fa-trash-o"></i> 删除</button>
                                        </div> 
                                    </td>
                                </tr>
                            <% } %>


                              
                                                
                            </tbody>
                        </table>
                    </div>

                    <div class="clearfix">
                        <div class="btn-toolbar pull-right pagebar"></div>
                    </div>
                    <!-- END PAGE CONTENT-->
                </div>
                <!-- END CONTENT BODY -->
            </div>
            <!-- END CONTENT -->
            
        </div>
        <!-- END CONTAINER -->
        <!-- #include file="../include/footer.inc" -->
        <!-- #include file="../include/com_res_js.inc" -->
    </body>
    
</html>
